<!-- 去签署 -->
<template>
  <a-modal
    v-model:visible="showModal"
    @close="onClose"
    @before-ok="onConfirm"
    :title="pageTlt"
    :mask-closable="false"
    class="modal-dialog-wrapper"
    unmount-on-close
    width="65vw"
  >
    <iframe :src="url" style="width: 100%; height: 70vh"></iframe>
  </a-modal>
</template>

<script setup name="OpenLink">
  import { ref } from 'vue'
  import { getTenantSignUrlAPI } from '@/api/order/sOrder'

  const pageTlt = ref('签署') //标题
  const showModal = ref(false)
  const url = ref('')

  const show = (record) => {
    console.log(record)
    showModal.value = true
    getTenantSignUrlAPI({ id: record.id }).then((res) => {
      console.log(res)
      url.value = res.result
    })
  }

  const onClose = () => {
    showModal.value = false
  }

  const emit = defineEmits(['ok'])

  const onConfirm = () => {
    showModal.value = false
    emit('ok')
  }

  defineExpose({
    show,
  })
</script>

<style lang="less" scoped>
  :deep(.arco-row) {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  :deep(.arco-row-align-start) {
    padding: 0 !important;
  }
  :deep(.arco-col) {
    padding: 0 10px !important;
  }
</style>
